package com.chixing.day15.day15_Home;


import java.io.*;

public class CopyDir {
    public static void main(String[] args){
    InputStream in = null;
    OutputStream out = null;

        try {
            in = new FileInputStream("F://workspacetools//CXJY_WORKSPACE//test1//hello.txt");
            out = new FileOutputStream("E://test1//hello.txt");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        byte[] bt = new byte[1024];
        int num = 0; //每次读取的字节数

            try {
                while ((num = in.read(bt)) != -1){
                    out.write(bt, 0, num);
                }
            } catch (IOException e) {
               e.printStackTrace();
            }

            try {
                in.close();
                out.close();
            } catch (IOException e) {
                e.printStackTrace();
            }

        }
}
